package com.bt.lms.ui.action.school_education.stu_msg_manage;

import com.bt.lms.ui.page.school_education.archives.PageSchoolRecordMes;
import com.bt.lms.ui.page.school_education.stu_mes_manage.PageStudentMesManage;
import javafx.collections.ObservableList;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;

/**
 * 学籍档案信息事件
 */
public class SchoolRecordMesAction implements EventHandler {
    //维护
    private PageStudentMesManage pageStudentMesManage;

    //这边接一下，收到那边的界面
    public SchoolRecordMesAction(PageStudentMesManage pageStudentMesManage){
        this.pageStudentMesManage = pageStudentMesManage;

    }
    @Override
    public void handle(Event event) {

        //获取里边有几个盒子
       ObservableList<Node> children = pageStudentMesManage.getChildren();

        HBox hBox = (HBox) children.get(0);
        ObservableList<Node> hBoxChildren = hBox.getChildren();
        hBoxChildren.remove(3);
        Label label = new Label(">学籍档案信息");
        hBoxChildren.add(label);

        //调用方法，创建一个新的加进去
        PageSchoolRecordMes pageSchoolRecordMes = new PageSchoolRecordMes(pageStudentMesManage);
        children.set(2, pageSchoolRecordMes);

    }

}
